<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Sistema de fichas</title>


    <link rel="stylesheet" type="text/css"
	  href="/Fichas/lib/ext/resources/css/ext-all.css" />
    <link rel="stylesheet" type="text/css"
    	href="/Fichas/lib/ext/ux/fileuploadfield/css/fileuploadfield.css"></link>

    <script type="text/javascript" src="/Fichas/lib/ext/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="/Fichas/lib/ext/ext-all.js"></script>
    <script type="text/javascript" src="/Fichas/views/js/MenuPrincipal.js"></script>
    <script type="text/javascript" src="/Fichas/views/js/PanelSimple.js"></script>
    <script type="text/javascript" src="/Fichas/views/js/FormularioFicha.js"></script>



    <script type="text/javascript" src="/Fichas/lib/ext/ux/fileuploadfield/FileUploadField.js"></script>



  </head>
  <body id="docbody">
    <script type="text/javascript">
    Ext.onReady(function() {
	centro = new Ext.form.FormPanel(PanelSimple({
	    title: "Carga de datos",
	    region: 'center',
	    items:[{
		fileupload: true,
		defaults: {
		    allowBlank: false,
	   	    border: false
		},
		items:[
		    {
			    id: 'data',
				xtype: 'fileuploadfield',
				width: 300,
				emptyText: 'Seleccione una planilla para cargar...',
				fieldLabel: 'Archivo',
				buttonText: 'Buscar'
		    }
		],
		buttons: [
		    {
			text: 'Cargar',
			handler: function () {
			    if (centro.getForm().isValid()) {
				centro.getForm().submit({
				    url: '/Fichas/controllers/cargaMasiva.php',
				    waitMsg: 'Procesando...',
				    success: function (form, action) {
					msg('Terminado', 'Se ha procesado la planilla');
				    }
				});
			    }
			}
		    }
		]

	    }]
	}));

	var tb = MenuPrincipal();

	var appLayout = new Ext.Viewport({
	    renderTo: "docbody",
	    layout:'border',
	    autoScroll: true,
	    items: [
		{
		    title: 'Sistema Fichas UAAEP',
		    autoHeight: true,
		    region: 'north',
		    items:[
			tb
		    ]
		},
		centro
	    ]
	});

	
    });

    </script>
    <div id='nica'></div>
  </body>
</html>
